package work1;

public class Consumer extends Thread{
    private Box box;
    public Consumer(Box box){
        this.box = box;
    }
    @Override
    public void run(){
        while(true){
            try {
                box.consume();
                Thread.sleep(200);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
